package de.lns.ui.menu;

import java.nio.FloatBuffer;

import de.lns.render.Drawable;
import de.lns.render.Model;
import de.lns.render.ModelFactory;
import de.lns.render.TextureLoader;

public class Label implements Drawable {
	private Model model;
	private int posX;
	private int posY;
	private int posZ;
	private int textureID;
	private String texturePath;
	private int width;
	private int height;
	private FloatBuffer mesh;
	private static FloatBuffer map;
	static{
		map = ModelFactory.genRectMap();
	}

	public Label(Model model, int x, int y, int width, int height){
		this.model=model;
		this.posX=x;
		this.posY=y;
		this.width=width;
		this.height=height;
		mesh = ModelFactory.genRectMesh(width, height, width/2, height/2);
		
		this.textureID=TextureLoader.loadTexture(texturePath);
	}

	@Override
	public Model model() {
		return model;
	}

	@Override
	public double getScale() {
		return 1;
	}

	@Override
	public double getPosX() {
		return posX;
	}

	@Override
	public double getPosY() {
		return posY;
	}

	@Override
	public double getPosZ() {
		return posZ;
	}

	@Override
	public double getDirection() {
		return 0;
	}

	@Override
	public FloatBuffer getMesh() {
		return mesh;
	}

	@Override
	public FloatBuffer getMapping() {
		return map;
	}

	@Override
	public int getTextureID() {
		return textureID;
	}
	public String getTexturePath() {
		return texturePath;
	}

	public void setTexturePath(String texturePath) {
		this.texturePath = texturePath;
	}
	public void setModel(Model model) {
		this.model = model;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	@Override
	public boolean alignRel() {
		return false;
	}
}
